//
//  NSString+LKChinese.m
//  YuxiCloud
//
//  Created by LIUKUN-PC on 17/4/10.
//  Copyright © 2017年 ynnissi. All rights reserved.
//

#import "NSString+LKChinese.h"

@implementation NSString (LKChinese)

- (BOOL)isChinese {
    
    NSString *match = @"(^[\u4e00-\u9fa5]+$)";
    NSPredicate *predicate = [NSPredicate predicateWithFormat:@"SELF matches %@", match];
    return [predicate evaluateWithObject:self];
}

- (BOOL)includeChinese {
    
    for(int i = 0; i < [self length]; i++) {
        int a =[self characterAtIndex:i];
        if( a > 0x4e00 && a < 0x9fff){
            return YES;
        }
    }
    return NO;
}

@end
